package com.ruoyi.service;

import com.ruoyi.mapper.SysParameterMapper;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;
import java.util.Map;

@Service
public class SysParameterServiceImpl implements SysParameterService {

    @Autowired
    SysParameterMapper sysParameterMapper;


    @Override
    public List<Map<String, Object>> findNameByType(String type) {
        return sysParameterMapper.findNameByType(type);
    }

    @Override
    public int remove(String ids) {
        return sysParameterMapper.remove(ids);
    }

    @Override
    public Map<String, Object> findParameter(String id) {
        return sysParameterMapper.findParameter(id);
    }

    @Override
    public int save(Map<String, Object> map) {
        int num = 0;
        if (!map.containsKey("id")) {
            num = sysParameterMapper.add(map);
        } else {
            num = sysParameterMapper.edit(map);
        }
        return num;
    }

    @Override
    public int checkNameUnique(Map<String, Object> map) {
        return sysParameterMapper.checkNameUnique(map);
    }


}
